package com.atguigu.daijia.payment.config;

import com.wechat.pay.java.core.RSAAutoCertificateConfig;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix="wx.pay") //读取节点
@Data
public class WxPayV3Properties {

    /**
     * 设置微信公众号或者小程序等的appid.
     */
    private String appId;

    /**
     * 微信支付商户号.
     */
    private String mchId;

    /**
     * 微信支付商户密钥.
     */
    private String mchKey;


    /**
     * apiclient_cert.p12文件的绝对路径，或者如果放在项目中，请以classpath:开头指定.
     */
    private String keyPath;

    private String notifyUrl;



//    @Bean
//    public RSAAutoCertificateConfig getConfig(){
//        return new RSAAutoCertificateConfig.Builder()
//                .merchantId(this.getMchId())
//                .privateKeyFromPath(this.getKeyPath())
//                .build();
//
//    }
}
